package com.shanyu.nicefish.common;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

// spring启动时，加载数据
@Component //交给spring托管
public class LoadProductType implements ApplicationListener<ContextRefreshedEvent> {

    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        System.out.println("spring启动之后,加载数据库");
    }
}
